package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.param.BaseParam;
import com.cskaoyan.bean.vo.TopicListVO;
import com.cskaoyan.bean.vo.WxTopicDetailVO;
import com.cskaoyan.service.TopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 小程序-专题
 * 创建日期: 2022/04/09 12:52
 *
 * @author ChengWenqi
 */

@RestController
@RequestMapping("wx/topic")
public class WxTopicController {

    @Autowired
    TopicService topicService;

    // 获取全部专题 wx/topic/list
    @RequestMapping("list")
    public BaseRespVo topicList(BaseParam param) {
        TopicListVO topicListVO = topicService.queryWxTopicList(param);
        return BaseRespVo.ok(topicListVO);
    }


    // 获取专题详情 wx/topic/detail
    @RequestMapping("detail")
    public BaseRespVo topicDetail(Integer id) {
        WxTopicDetailVO wxTopicDetailVO = topicService.queryWxTopicDetail(id);
        return BaseRespVo.ok(wxTopicDetailVO);
    }


    // 相关专题推荐 wx/topic/related
    @RequestMapping("related")
    public BaseRespVo topicRelated(Integer id) {
        TopicListVO topicListVO = topicService.queryWxTopicRelated(id);
        return BaseRespVo.ok(topicListVO);
    }
}
